<?php
/** @var ProductoCategoriaController $this */
/** @var ProductoCategoria $model */
$this->menu = array(
    array('label' => Yii::t('AweCrud.app', 'Create'), 'icon' => 'plus', 'url' => array('create'),
    //'visible' => (Util::checkAccess(array('action_incidenciaPrioridad_create')))
    ),
);
?>
<div id="flashMsg"  class="flash-messages">

</div> 
<div class="widget blue">
    <div class="widget-title">
        <h4> <i class="icon-fire-extinguisher"></i> <?php echo Yii::t('AweCrud.app', 'Manage') ?> <?php echo ProductoCategoria::label(2) ?> </h4>
        <span class="tools">
            <a href="javascript:;" class="icon-chevron-down"></a>
            <!--a href="javascript:;" class="icon-remove"></a-->
        </span>
    </div>
    <div class="widget-body">

        <?php
        $this->widget('booster.widgets.TbGridView', array(
            'id' => 'producto-categoria-grid',
            'type' => 'striped bordered hover advance',
            'dataProvider' => $model->search(),
            'columns' => array(
                'nombre',
                array(
                    'name' => 'estado',
                    'filter' => array('ACTIVO' => 'ACTIVO', 'INACTIVO' => 'INACTIVO',),
                ),
                     array(
                            'class' => 'CButtonColumn',
                            'template' => '{delete}{update} ',
                            'afterDelete' => 'function(link,success,data){
                                            if(success) {
                                                 $("#flashMsg").empty();
                                                 $("#flashMsg").css("display","");
                                                 $("#flashMsg").html(data).animate({opacity: 1.0}, 5500).fadeOut("slow");
                                            }
                                }',
                            'buttons' => array(
                                'update' => array(
                                    'label' => '<button class="btn btn-primary"><i class="fa fa-pencil"></i></button>',
                                    'options' => array('title' => 'Actualizar'),
                                    'imageUrl' => false,
                                ),
                                'delete' => array(
                                    'label' => '<button class="btn btn-primary"><i class="glyphicon glyphicon-trash "></i></button>',
                                    'options' => array('title' => 'Eliminar'),
                                    'imageUrl' => false,
                                ),
                            ),
                            'htmlOptions' => array(
                                'width' => '120px'
                            )
                        ),
            ),
        ));
        ?>
    </div>
</div>